<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<script src='/webjars/jquery/2.1.4/dist/jquery.min.js'></script>
<script src="/webjars/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="/webjars/bootstrap-fileinput/4.3.1/js/fileinput.min.js"></script>
<script src="/webjars/bootstrap-fileinput/4.3.1/js/fileinput_locale_zh.js"></script>
<!-- 自定义js -->
<script src="/plugins/customer-file.js"></script>
<script src="/plugins/common.js"></script>


<script src="/plugins/background/jquery.particleground.min.js"></script>
<script src="/plugins/background/2.js"></script>

<!--图表插件-->
<script src="/webjars/echarts/5.0.2/dist/echarts.min.js"></script>


<script>

    $(".num").onlyNum();
    $(".double").onlyDouble();

</script>
<script>
    var tipMessage = "${message}";
    if (tipMessage.length > 0) {
        tipMsg(tipMessage);
    }

    function tipMsg(msg) {
        alert(msg);
    }

</script>

<canvas id="background"></canvas>
<div id="particles"></div>
<script>
    $(document).ready(function() {
        $('#particles').particleground({
            dotColor: '#5cbdaa',
            lineColor: '#5cbdaa'
        });
    });
</script>
<div class="modal fade bs-example-modal-sm" id="info" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">修改密码</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal">
                    <div class="input-group has-success col-xs-6" style="margin: 10px auto;">
                        <span class="input-group-addon" style="width: 90px;">原&nbsp;密&nbsp;码:</span>
                        <input type="password" class="form-control" name="password">
                    </div>
                    <div class="input-group has-success col-xs-6" style="margin: 10px auto;">
                        <span class="input-group-addon" style="width: 90px;">新&nbsp;密&nbsp;码:</span>
                        <input type="password" class="form-control" name="pwd">
                    </div>
                    <div class="input-group has-success col-xs-6" style="margin: 10px auto;">
                        <span class="input-group-addon" style="width: 90px;">确认密码:</span>
                        <input type="password" class="form-control" name="pwd2">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-primary" onclick="pwd_submit()">修改</button>
            </div>
        </div>
    </div>
</div>
<script>
    function pwd_submit() {
        var password = $('input[name="password"]').val();
        var pwd = $('input[name="pwd"]').val();
        var pwd2 = $('input[name="pwd2"]').val();
        if (pwd.length == 0) {
            alert("请输入新密码");
            return;
        }
        if (pwd2.length == 0) {
            alert("请输入确认密码");
            return;
        }
        if (pwd != pwd2) {
            alert("两次密码不一样");
            return;
        }
        $.getJSON("/admin/modifyPwd", {password: password, pwd: pwd, pwd2: pwd2}, function (result) {
            if (result.code == 200) {
                alert("修改成功");
                location.href = "/admin/login";
            } else {
                alert(result.message);
                location.reload(true);
            }
        })
    }
</script>



<!-- 动画插件 -->
<script src="https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js"></script>
<script>
    L2Dwidget.init({
        "model": {
            /**
             * chitose
             * epsilon2.1
             * gantzert_felixander
             * haru01
             * haru02
             * haruto
             * hibiki
             * hijiki
             * izumi
             * koharu
             * miku
             * nico
             * ni-j
             * nipsilon
             * nito
             * shizuku
             * tororo
             * tsumiki
             * Unitychan
             * wanko
             * z16
             * koharu
             */

            //jsonpath控制显示那个小萝莉模型，下面这个就是我觉得最可爱的小萝莉模型，替换时后面名字也要替换掉
            //jsonPath: "https://unpkg.com/live2d-widget-model-koharu@1.0.5/assets/koharu.model.json",
            jsonPath: "https://unpkg.com/live2d-widget-model-shizuku/assets/shizuku.model.json",
            "scale": 1
        },
        "display": {
            "position": "left", //看板娘的表现位置 right top
            "width": 80,  //小萝莉的宽度
            "height": 160, //小萝莉的高度
            "hOffset": 0,
            "vOffset": -20
        },
        "mobile": {
            "show": true,
            "scale": 0.5
        },
        "react": {
            "opacityDefault": 0.7,
            "opacityOnHover": 0.2
        },
        "dialog": {
            "enable": true,
            "script": {
                'tap body': '哎呀！别碰我！',
                'tap face': '人家是在认真学习哦-~~',
            }
        }
    });
</script>